import Layout from "@/views/layout/index";

/**
 * 超级管理员的路由列表
 * @type {*[]}
 */
export const superAdminRouter = [
  {
    path: "/",
    component: Layout,
    redirect: "/index",
    name: "Dashboard",
    meta: { title: "首页", icon: "dashboard", roles: ["ROLE_ROOT"] },
    hidden: false,
    children: [
      {
        path: "index",
        meta: {
          title: "运营总览",
          icon: "dashboard",
          roles: ["ROLE_ROOT"]
        },
        component: () => import("@/views/super-admin/Dashboard")
      }
    ]
  },
  {
    path: "/basic",
    component: Layout,
    redirect: "/basic/category",
    name: "BasicInfo",
    meta: { title: "基础资料", icon: "qiye_info", roles: ["ROLE_ROOT"] },
    hidden: false,
    children: [
      {
        path: "category",
        meta: {
          title: "商品分类"
        },
        component: () => import("@/views/super-admin/basic/ItemCate")
      },
      {
        path: "brand_model",
        meta: {
          title: "品牌型号"
        },
        component: () => import("@/views/super-admin/basic/BrandAdmin")
      },
      {
        path: "shop_config",
        meta: {
          title: "店铺设置"
        },
        component: () => import("@/views/super-admin/basic/ShopConfig")
      }
    ]
  },
  {
    path: "/diy",
    component: Layout,
    redirect: "/diy/mb_case/molds",
    name: "DiyCenter",
    meta: { title: "定制中心", icon: "qiye_info", roles: ["ROLE_ROOT"] },
    hidden: false,
    children: [
      {
        path: "styles",
        meta: {
          title: "图库风格"
        },
        component: () => import("@/views/super-admin/diy/mb_case/SampleStyle")
      },
      {
        path: "mb_case",
        meta: {
          title: "手机壳定制"
        },
        redirect: "/diy/mb_case/molds",
        component: () => import("@/views/super-admin/diy/DiyParent"), // Parent router-view
        children: [
          {
            meta: {
              title: "定制属性"
            },
            path: "item_props",
            component: () =>
              import("@/views/super-admin/diy/mb_case/DiyMbCaseItemProp")
          },
          {
            path: "bind_mold",
            props: route => ({
              skuId: route.query.sku_id,
              skuName: route.query.sku_name
            }),
            name: "BindMold",
            meta: { title: "绑定模具" },
            hidden: true,
            component: () =>
              import("@/views/super-admin/diy/mb_case/SkuMoldBind")
          },
          {
            meta: {
              title: "模具管理"
            },
            path: "molds",
            component: () =>
              import("@/views/super-admin/diy/mb_case/MbCaseMold")
          },

          {
            meta: {
              title: "图库设置"
            },
            path: "samples",
            component: () =>
              import("@/views/super-admin/diy/mb_case/MbCaseSample")
          }
        ]
      },

      {
        path: "ear_muff",
        meta: {
          title: "耳机套定制"
        },
        redirect: "/diy/ear_muff/item_props",
        component: () => import("@/views/super-admin/diy/DiyParent"), // Parent router-view
        children: [
          {
            meta: {
              title: "定制属性"
            },
            path: "item_props",
            component: () =>
              import("@/views/super-admin/diy/ear_muff/DiyEarMuffItemProp")
          },
          {
            meta: {
              title: "给指定规格设置模板"
            },
            props: route => ({
              skuId: route.query.sku_id,
              skuName: route.query.sku_name
            }),
            hidden: true,
            path: "sku_templates",
            component: () =>
              import("@/views/super-admin/diy/ear_muff/SkuEarMuffTemplates")
          },
          {
            meta: {
              title: "模板管理"
            },
            path: "templates",
            component: () =>
              import("@/views/super-admin/diy/ear_muff/EarMuffTemplates")
          },
          {
            meta: {
              title: "模板编辑"
            },
            props: route => ({
              skuId: route.query.sku_id,
              skuName: route.query.sku_name,
              tempId: route.query.temp_id
            }),
            hidden: true,
            path: "edit_template",
            component: () =>
              import("@/views/super-admin/diy/ear_muff/EarMuffTemplateEdit")
          }
        ]
      },
      {
        path: "tablet_muff",
        meta: {
          title: "平板套定制"
        },
        redirect: "/diy/tablet_muff/item_props",
        component: () => import("@/views/super-admin/diy/DiyParent"), // Parent router-view
        children: [
          {
            meta: {
              title: "定制属性"
            },
            path: "item_props",
            component: () =>
              import("@/views/super-admin/diy/tablet_muff/DiyTabletMuffProp")
          },
          {
            meta: {
              title: "模板管理"
            },
            path: "templates",
            component: () =>
              import("@/views/super-admin/diy/tablet_muff/TabletMuffTemplates")
          },
          {
            meta: {
              title: "模板设置"
            },
            props: route => ({
              skuId: route.query.sku_id,
              skuName: route.query.sku_name
            }),
            hidden: true,
            path: "sku_templates",
            component: () =>
              import(
                "@/views/super-admin/diy/tablet_muff/SkuTabletMuffTemplates"
              )
          },
          {
            meta: {
              title: "模板编辑"
            },
            props: route => ({
              skuId: route.query.sku_id,
              skuName: route.query.sku_name,
              tempId: route.query.temp_id
            }),
            hidden: true,
            path: "edit_template",
            component: () =>
              import(
                "@/views/super-admin/diy/tablet_muff/TabletMuffTemplateEdit"
              )
          }
        ]
      }
      // {
      //   path: "brand_model",
      //   meta: {
      //     title: "品牌型号"
      //   },
      //   component: () => import("@/views/super-admin/basic/BrandAdmin")
      // },
      // {
      //   path: "express_setting",
      //   meta: {
      //     title: "运费设置"
      //   },
      //   component: () => import("@/views/super-admin/basic/ShopConfig")
      // }
    ]
  },
  {
    path: "/shop",
    component: Layout,
    redirect: "/shop/items",
    name: "ItemCenter",
    meta: { title: "商城设置", icon: "goods", roles: ["ROLE_ROOT"] },
    hidden: false,
    children: [
      {
        path: "items",
        meta: {
          title: "商品管理"
        },
        component: () => import("@/views/super-admin/shop-center/ItemAdmin")
      },
      {
        path: "articles",
        meta: {
          title: "文章管理"
        },
        component: () => import("@/views/super-admin/shop-center/ArticleList")
      },
      {
        path: "article_edit",
        name: "ArticleEdit",
        meta: { title: "文章编辑" },
        hidden: true,
        component: () => import("@/views/super-admin/shop-center/ArticleEdit")
      },
      {
        path: "ideas",
        name: "BuyerIdeas",
        meta: { title: "用户反馈" },
        hidden: false,
        component: () => import("@/views/super-admin/shop-center/BuyerIdea")
      },
      {
        path: "item_edit",
        props: route => ({
          itemId: route.query.id
        }),
        name: "EditItem",
        meta: { title: "编辑商品" },
        hidden: true,
        component: () => import("@/views/super-admin/shop-center/ItemEdit")
      },
      {
        path: "sku_edit",
        props: route => ({
          itemId: route.query.id,
          itemName: route.query.name
        }),
        name: "EditSku",
        meta: { title: "编辑规格" },
        hidden: true,
        component: () => import("@/views/super-admin/shop-center/ItemSkuEdit")
      },
      {
        path: "sku_sample",
        props: route => ({
          itemId: route.query.item_id,
          itemName: route.query.item_name,
          skuName: route.query.sku_name
        }),
        name: "SkuSample",
        meta: { title: "设置规格样本" },
        hidden: true,
        component: () => import("@/views/super-admin/shop-center/SkuSample")
      },
      {
        path: "desc_edit",
        props: route => ({
          itemId: route.query.id,
          itemName: route.query.name
        }),
        name: "ItemDescEdit",
        meta: { title: "图文详情" },
        hidden: true,
        component: () => import("@/views/super-admin/shop-center/ItemDescEdit")
      }
    ]
  },
  {
    path: "/order",
    component: Layout,
    redirect: "/order/list",
    name: "OrderCenter",
    meta: { title: "订单中心", icon: "order", roles: ["ROLE_ROOT"] },
    hidden: false,
    children: [
      {
        path: "list",
        name: "OrderList",
        meta: { title: "订单管理" },
        component: () => import("@/views/super-admin/order-center/OrderList")
      },
      {
        path: "appeals",
        name: "OrderAppeal",
        meta: { title: "售后管理" },
        component: () =>
          import("@/views/super-admin/order-center/OrderAppealList")
      }
    ]
  },
  {
    path: "/sem",
    component: Layout,
    redirect: "/sem/coupons",
    name: "SEM",
    meta: { title: "营销中心", icon: "coupon", roles: ["ROLE_ROOT"] },
    children: [
      {
        path: "coupons",
        name: "CouponList",
        meta: { title: "优惠券管理" },
        component: () => import("@/views/super-admin/sem-center/ShopCoupon")
      },
      {
        path: "analyze",
        name: "CouponAnalyze",
        meta: { title: "领券分析" },
        component: () => import("@/views/super-admin/sem-center/UserCoupon")
      }
    ]
  }
];
